using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using Avalonia.Controls;
using AYE.BaseFramework.Manager;
using AYE_ClientSideAvalonia.Models;
using AYE_ClientSideAvalonia.Views;
using Material.Icons;
using MediatR;
using Prism.Commands;
using Prism.Navigation.Regions;

namespace AYE_ClientSideAvalonia.ViewModels;

public class UCSidebarViewModel : ViewModelBase
{
    private readonly IRegionManager _regionManager;
    public ObservableCollection<MenuItemModel> MenuItems { get; set; }
    public DelegateCommand<MenuItemModel> NavigateCommand =>
        new((it) =>
        {
            _regionManager.RequestNavigate(AyeClientSideAvaloniaRegionNames.MainContentRegion, it.UserControlName);
        });

    public UCSidebarViewModel(IRegionManager regionManager)
    {
        _regionManager = regionManager;
        MenuItems = new ObservableCollection<MenuItemModel>
        {
            //new MenuItemModel { IconKind = MaterialIconKind.DotsVertical, Title = "Dashboard" },
            //new MenuItemModel { IconKind = MaterialIconKind.Adjust, Title = "Something Else" },
            //new MenuItemModel { IconKind = MaterialIconKind.Apple, Title = "Something Else" }

            new MenuItemModel { IconKind =  "DotsVertical", Title = "Dashboard" ,UserControlName="DashboardView"},
            new MenuItemModel { IconKind =  "Adjust", Title = "Something Else",UserControlName="DashboardView" },
            new MenuItemModel { IconKind =  "Apple", Title = "Something Else" ,UserControlName="DashboardView"}

        };
        foreach (var item in MenuItems)
        {
            item.MenuItemCommand = NavigateCommand;
        }

        

    }

     
}
